package day06;

import java.util.Random;

public class Homework2 {
    public static void main(String[] args) {
        Random rand = new Random();
        int[] arr = new int[10];
        for (int i=0;i<arr.length;i++){
            arr[i] = rand.nextInt(100);
        }
        int max = getMaxOfArray(arr);
        System.out.println(max);
        System.out.println("-----------");
        int[] arr1={11,12,13,14,15};
        printArrayData(arr1);
    }
    public static int getMaxOfArray(int[] arr){
        int max = arr[0];
        for (int i=1;i<arr.length;i++){
            if (arr[i]>max){
                max = arr[i];
            }
        }
        return max;
    }

    public static void printArrayData(int[] arr1){
        for(int i=0;i<arr1.length;i++){
            System.out.println(arr1[i]);
        }
    }
}
